<?
include_once 'include/include.php';
c_create::createClass('setPage');
$page = new setPage();
c_create::createClass('friendlink');
$link = new friendlink();
$outvar[headline] = '友情链接管理列表';
if ($_GET[did]){
	if ($link->deleteRecord($_GET[did])){
		$_SESSION[showtips]	 = '删除成功！';
	}else {
		$_SESSION[showtips]	 = '删除失败！';
	}
}
if ($_GET[Ltopicid]){
	$where = ' where Ltopicid='.$_GET[Ltopicid];
	$outvar[Ltopicid] = $_GET[Ltopicid];
}

$where = " $where order by Lorder desc,Llinkid desc";
$query = "select count(*) from ".TABLE_FRDLINK.$where;
$page->setPagePHP(20,10,$dbconn->Getonefield($query));
$query = "select * from ".TABLE_FRDLINK.$where.$page->limit;
$nowQueryid = $dbconn->Query($query);
$i = 0;
while ($row = $dbconn->next_record($nowQueryid)){
	$row[num] = $i+1;
	$row[Ltopicname] = $link->getTypeName($row[Ltopicid]);
	$array[] = $row;
	$i++;
}
$outvar[page] = $page->menuAll;
$outvar[record] = $array;
$outvar[fileurl_1] = getFileWithVar('',array('id','did'));
$outvar[fileurl_2] = getFileWithVar('',array('id','did','Ltopicid'));
$outvar[typelist] = $link->getTypeList();

require_once("./include/xajax_common.php");
$outvar[xajax_javascript] = $xajax->getJavascript('../module/xajax/');

outFile("friendlink_manage");
?>